//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	ICamlQueryExecutor.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using Microsoft.SharePoint;

namespace Smart.Common.Entities
{
	/// <summary>
	/// Caml SharePoint list query executor
	/// </summary>
	public interface ICamlQueryExecutor
	{
		/// <summary>
		/// Query
		/// </summary>
		IQueryBuilder<ICamlQueryExecutor> Query { get; set; }

		/// <summary>
		/// SharePoint list
		/// </summary>
		SPList List { get; set; }

		/// <summary>
		/// Web
		/// </summary>
		SPWeb Web { get; set; }

		/// <summary>
		/// Site data query
		/// </summary>
		SiteQuery SiteQuery { get; set; }

		/// <summary>
		/// Execute query and return all items
		/// </summary>
		SPListItemCollection GetItems();

		/// <summary>
		/// Execute query and return first item
		/// </summary>
		SPListItem GetItem();

		/// <summary>
		/// Execute query and return top <paramref name="rowLimit"/> items
		/// </summary>
		SPListItemCollection GetItems(int rowLimit);

		/// <summary>
		/// Execute <paramref name="query"/> and return top <paramref name="rowLimit"/> items
		/// </summary>
		SPListItemCollection GetItems(IQueryBuilder query, int rowLimit);
	}
}